/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUInemeanshop;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Formatter;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author havardaxelsen
 */
public class Test {
        
    
    
    public static void main(String args[]) {
       
        
          String pw = "2a2e1206b4222b0d7cc8c8a1d8b302ee70cfe817";
          
          byte[] mba = pw.getBytes();
     
            System.out.println(byteArray2Hex(mba));
        
        
          
       
      
}
    
    public static String SHAsum(byte[] convertme) throws NoSuchAlgorithmException{
    MessageDigest md = MessageDigest.getInstance("SHA-1"); 
    return byteArray2Hex(md.digest(convertme));
}

    private static String byteArray2Hex(final byte[] hash) {
    Formatter formatter = new Formatter();
    for (byte b : hash) {
        formatter.format("%02x", b);
    }
    return formatter.toString();
}

}


